grids
Programs do not draw directly into windows. Programs create one or more grids in each window, each of which is a rectangular area with its own coordinate systems and attributes like size, background color, drawing color, drawpoints, etc.

The attribute settings in each grid are private, so graphics operations in one grid have no effect on other grids. No matter how many grids a program creates, each grid is independent.

To create a grid, programs call:

XgrCreateGrid ( @grid, gridType, x, y, w, h, window, parent, func )

  grid - unique grid number returned to identify the grid
  gridType - number that specifies the grid type of the grid
  x - horizontal location of left edge of grid
  y - vertical location of upper edge of grid
  w - width of grid in pixels
  h - height of grid in pixels
  window - window number of window that contains grid
  parent - parent grid (0 if window is its parent)
  func - address of grid function that operates grid

grid
XgrCreateGrid() assigns a unique grid number to each grid. grid is the first argument to most GraphicsDesigner functions, so all graphics operations are directed at a single grid, and all other grids are unaffected.

grid type
Every grid has a grid type. Simple coordinate grids, suitable for all kinds of graphics, are grid type 0 . Image grids are grid type 1 .

These two grid types are pre-defined by GraphicsDesigner, and pure graphics programs need not create others. On the other hand, dozens of grid types exist in GUI programs - see GuiDesigner.

coordinate systems
GraphicsDesigner supports five coordinate systems:

Display Coordinates - 0,0 is upper left corner of display
Window Coordinates - 0,0 is upper left corner of window
Local Coordinates - 0,0 is upper left corner of grid
Grid Coordinates - specifies corners of grid in pixel units
Scaled Coordinates - specifies corners of grid in any units